// created by noellynch
// Jun 2, 2009

package com.sceneworker.extensions.passmanager;

import com.acarter.propertytable.Property;
import com.acarter.propertytable.PropertySection;
import com.acarter.propertytable.PropertySectionState;
import com.acarter.propertytable.PropertyTable;
import com.acarter.propertytable.propertyobject.BooleanPropertyObject;
import com.acarter.propertytable.propertyobject.FloatPropertyObject;
import com.acarter.propertytable.propertyobject.IntegerPropertyObject;
import com.acarter.scenemonitor.propertydescriptor.A_PropertyPage;
import com.acarter.scenemonitor.propertydescriptor.EmptyPropertyPage;
import com.jme.renderer.pass.BasicPassManager;
import com.jme.renderer.pass.Pass;

public class PassManagerPropertyPage extends A_PropertyPage {

	public PassManagerPropertyPage() {
		PropertySection section = new PropertySection("Pass Manager");
		section.addProperty(new Property("Number of Passes", new IntegerPropertyObject()));
		section.setState(PropertySectionState.EXPANDED);
		
		model.addPropertySection(section);
	}

	@Override
	public void updateModel(PropertyTable table, Object object) {
		if(object instanceof BasicPassManager) {
			
			final	BasicPassManager lcl_mgr = (BasicPassManager)object;
			
			IntegerPropertyObject		lcl_nPasses = (IntegerPropertyObject)model.getPropertySection("Pass Manager").getProperty("Number of Passes").getPropertyObject();
			lcl_nPasses.SetListener(new IntegerPropertyObject.I_IntegerPropertyObjectListener() {

				public int readValue() {
					return lcl_mgr.passes();
				}

				public void saveValue(int value) {
					
				}
				
			});
			
		}
	}

}
